package com.medical.mapper;

import com.medical.model.entity.User;
import org.apache.ibatis.annotations.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author TISNIW
 * @version 1.0
 * @date 2024/9/20 9:05
 * @desc
 */
@Mapper
public interface UserMapper {

    // ===================== 用户登录与注册相关 =====================
    /**
     * 根据用户UID查询用户信息（用于登录）
     */
    @Select("select * from users where username = #{uid}")
    User queryByUid(String uid);

    /**
     * 注册新用户
     */
    @Insert("insert into users(username, password) values(#{username}, #{password})")
    Integer addUser(@Param("username") String username, @Param("password") String password);
}
